package client;

import java.util.List;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.ZooKeeper;

public class Client1 {
	
	public static void main(String[] args) throws Exception {
//		CountDownLatch c = new CountDownLatch(1);
//		ZooKeeperWatcher zw= new ZooKeeperWatcher();
		//${__setProperty(Token,${token_1},)}
//		${__property(Token)}
//		wx/goods/detail
//		id	1181045	false	text/plain	true
		W1 w1 = new W1();
//		
		ZooKeeper zk = new ZooKeeper("127.0.0.1:2181", 10000, w1);
//		
		w1.zk = zk;
		
//		zk.exists("/aa1",	true);
//		zk.getData("/aa1", true, null);
		zk.getChildren("/aa1",	true);
//
		Thread.sleep(2000000);
		
		
		
//		String rs = zk.create("/aa1/a1", "127.0.0.2:8082".getBytes(),Ids.OPEN_ACL_UNSAFE ,CreateMode.EPHEMERAL_SEQUENTIAL );
//		System.out.println(rs+"-----------------");
//		byte [] b= zk.getData("/getOrder/a", true, null);
//		System.out.println(new String(b));
		
//		List<String> children = zk.getChildren("/getOrder",	true);
//		System.out.println(children);
//		for(String p:children) {
//			
//			byte [] b=zk.getData("/getOrder/"+p, true, null);
//			System.out.println(p+" : "+new String(b));
//		}
//		zw.zk = zk;
//		c.await();
	}

}
